#include<stdio.h>
#include<unistd.h>
#include<sys/wait.h>
// 条件进程替换

int main()
{
   
   pid_t  ret =  fork();
  
   // 由子进程进行进程替换
   if(ret == 0)
   {
      execl("../2024_12_07/TextNoBlock.exe","TextNoBlock.exe",NULL);

      perror("execl\n"); 
   }

   int status = 0;
   pid_t ret1 = waitpid(ret ,&status , 0);
   
   if(ret1 == ret)
   {
     printf("wait等待成功,子进程被回收\n");
   }

   


   return 0;
}
